package jd

import "context"

type accessToken struct{}

func NewSessionContext(parent context.Context, session string) context.Context {
	return context.WithValue(parent, accessToken{}, session)
}

func FromSessionContext(ctx context.Context) (session string, ok bool) {
	session, ok = ctx.Value(accessToken{}).(string)
	return
}
